#!/bin/bash
echo " *******************************************************"
echo " *                                                     *"
echo " *                        diffu                        *"
echo " *                                                     *"
echo " *        Make a diffusiogram from two aerosol         *"
echo " *               optical depth pgm maps                *"
echo " *                                                     *"
echo " *   Martin Aube 2000                                  *"
echo " *                                                     *"
echo " *******************************************************"
echo " "
folder=`pwd`
rm -f core
echo " Experiment directory "$folder
if [ -f diffusio.par ] 
   then   echo " Using existing input parameter file: diffusio.par"

   else   epar_diffu   
fi 
ls *.pgm
ln -s ~/AODSEM/Bin/diffusio diffusio
echo " Executing diffusio..."
./diffusio
echo " Deleting temporary files in " $folder
rm -f diffusio
if [ -f core ] 
   then   echo "******** An error occured during execution of diffu! ********"
   rm -f core
   echo "Hit <CTRL-c> or <CRTL-z> to kill that process"
   read bidon
else
  echo " Normal end of diffu." 
fi 


